#include <iostream>
class Base
{
public:
    virtual void test()
    {
        std::cout << "Base class...";
    }
};

class Child : public Base
{
public:
    void test() override
    {
        std::cout << "Child class...";
    }
};

class GrandChild : public Child
{
public:
    void test() override
    {
        std::cout << "Child class...";
    }
};

/* 
作者: 苏丙榅
链接: https://subingwen.cn/cpp/final/
来源: 爱编程的大丙
著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。 */